﻿<!DOCTYPE html>
<!--承包商违章台账-领导审批-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
    </style>
</head>
<body>
    <div id="app" v-cloak class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                 size="mini">
            <el-row>
                <el-col :span="24">
                    <p class="main-label">{{ContractorPersonnelDirectory.ContractorName+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.cbS_List.contractorName}}</p>
                </el-col>
                <el-col :span="11">
                    <p class="main-label">{{ContractorViolationAccount.Violators+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.cbS_User.personnelName}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">{{ContractorViolationAccount.ViolationDate+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.violationDate}}</p>
                </el-col>
                <el-col :span="11">
                    <p class="main-label">{{ContractorViolationAccount.DiscoveringPeople+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.discoveringPeople}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">{{ContractorViolationAccount.FoundArea+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.sysArea.name}}</p>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <p class="main-label">{{ContractorViolationAccount.ViolationClause+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.violationClause}}</p>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <p class="main-label">{{ContractorViolationAccount.ViolationInstructions+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.violationInstructions}}</p>
                </el-col>
                <el-col :span="24">
                    <p class="main-label">{{ContractorViolationAccount.ProcessingOpinion+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.processingOpinion}}</p>
                </el-col>
                <el-col :span="24">
                    <p class="main-label">{{ContractorViolationAccount.IsBlacklist+mark.m}}</p>
                    <p class="lh35">{{Form.cbs_breakrules.isBackList}}</p>
                </el-col>
                <!--<div class="el-table el-table--fit el-table--striped el-table--border el-table--enable-row-hover el-table--enable-row-transition"
                     style="width: 100%;">
                    <div class="">
                        <table cellspacing="0" cellpadding="0" border="0" class="el-table__footer" style="width: 100%">
                            <tbody class="has-gutter">
                                <tr v-for='(item,i) in Form.cbS_BreakRulesApprove1'>
                                    <td colspan="1" rowspan="1" class="el-table_1_column_1 is-leaf" style="width: 185px">
                                        <div class="cell">{{item.examinUserTypeText}}</div>
                                    </td>
                                    <td colspan="1" rowspan="1" class="el-table_1_column_2 is-leaf">
                                        <el-row class="cell">
                                            <el-col :span="3">
                                                <div class="cell">审批意见：</div>
                                            </el-col>
                                            <el-col :span="12">
                                                <div class="elst-select-mini">
                                                    <el-form-item>
                                                        <div style="position: absolute;z-index:999;left:0;right:0;margin-left:10px;">
                                                            {{item.examineContent}}
                                                            <el-input v-if="Form.cbs_breakrules.state === '2' " type="text" v-model="item.examineContent" autocomplete="off" style="width:100% !important;border: 1px solid #DCDFE6;" size="mini">
                                                </el-input>
                                                <el-input v-else type="text" v-model="item.examineContent" autocomplete="off" style="width:100% !important;border: 1px solid #DCDFE6;" size="mini" disabled>
                                                </el-input>
                                                        </div>
                                                    </el-form-item>
                                                </div>
                                            </el-col>
                                        </el-row>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>-->
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.cbs_breakRulesApprove.examineContent" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    审批意见
                                </template>
                            </el-input>
                            <span class="iputLineMust" v-if="!Form.cbs_breakRulesApprove.examineContent">
                                <!--必填项添加-->
                                <img src="/static/images/exclamation.png" alt="">
                            </span>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row><br>
    <el-row type="flex" justify="end">
        <el-form-item>
            <el-button type="primary" @click="onSubmitForm('ruleForm')">同意</el-button>
            <el-button type="primary" @click="onSubmitFormA('ruleForm')">不同意</el-button>
            <el-button type="primary" @click="onBack">{{col.btnBack}}</el-button>
        </el-form-item>
    </el-row>
    </el-form>

    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                //业务表单内容
                Form: {
                    cbs_breakrules: {
                        id: guidEmpty,
                        contractorName: '',
                        ViolationDate: '',
                        ViolationInstructions: '',
                        Violators: '',
                        ViolationClause: '',
                        DiscoveringPeople: '',
                        ProcessingOpinion: '',
                        IsBlacklist: '',
                        Remarks: '',
                        cbS_List: {},
                        cbS_User: {},
                        sysArea: {},
                    },
                    cbs_breakRulesApprove: {
                        ExamineContent:'',
                    },
                    ApproveId:'',
                },

                IsBlacklist: [],
                //表单验证
                rules: {
                    //'cbs_breakRulesApprove.examineContent': [
                    //    verification.NotNull,                       
                    //],
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                onBack: function () {
                    parent.app.ListItem.dialogVisible = false;
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            var cbs_break = 
                            onSubmitForm(this, '/api/CBS_BreakRulesApprove/Agreed', mythis.Form.cbs_breakRulesApprove);
                            //if (mythis.Form.cbs_breakRulesApprove.examineOrder == 1) {
                            //    mythis.Form.cbs_breakrules.state = '3';
                            //}
                            //if (mythis.Form.cbs_breakRulesApprove.examineOrder == 2) {
                            //    mythis.Form.cbs_breakrules.state = '4';
                            //}
                            //if (mythis.Form.cbs_breakRulesApprove.examineOrder == 2 && mythis.Form.cbs_breakRulesApprove.ExaminUserType =='04') {
                            //    mythis.Form.cbs_breakrules.state = '5';
                            //}
                            //if (mythis.Form.cbs_breakRulesApprove.examineOrder == 3) {
                            //    mythis.Form.cbs_breakrules.state = '6';
                            //}
                            //onSubmitForm(this, '/api/CBS_BreakRules/SaveApprove', mythis.Form.cbs_breakrules);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                onSubmitFormA: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/CBS_BreakRulesApprove/NoAgreed', mythis.Form.cbs_breakRulesApprove);
                            mythis.Form.cbs_breakrules.state = 0;
                            onSubmitForm(this, '/api/CBS_BreakRules/Save', mythis.Form.cbs_breakrules);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    var mythis = this;

                    myAjax("post", mythis, '/api/CBS_BreakRulesApprove/GetApproveList', { model: { BreakRulesId: mythis.id }, offset: 0, limit: 100 }, function (response) {
                        var cbS_BreakRulesMyApprove = response.data.pageData;
                        console.log('h11', cbS_BreakRulesMyApprove);
                        if (cbS_BreakRulesMyApprove.length > 0) {
                            mythis.ApproveId = cbS_BreakRulesMyApprove[0].id;
                            console.log('h12', mythis.ApproveId);
                        }
                    }, false);

                    getData(this, '/api/CBS_BreakRules/get2?id=' + this.id + '&id2=' + this.ApproveId);
                    //myAjax("post", mythis, '/api/CBS_BreakRulesApprove/GetList', { model: { BreakRulesId: mythis.id, ExamineState:'1' }, offset: 0, limit: 100 }, function (response) {
                    //    mythis.Form.cbS_BreakRulesApprove1 = response.data.pageData;
                    //    console.log('h1', mythis.Form.cbS_BreakRulesApprove);
                    //}, false);


                },
            },

            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>